
import { _decorator, Component, Node, Label, Canvas } from 'cc';
const { ccclass, property } = _decorator;

/**
 * Predefined variables
 * Name = start
 * DateTime = Wed Apr 13 2022 11:02:49 GMT+0800 (中国标准时间)
 * Author = xiaopang125
 * FileBasename = start.ts
 * FileBasenameNoExtension = start
 * URL = db://assets/start.ts
 * ManualUrl = https://docs.cocos.com/creator/3.4/manual/zh/
 *
 */
 
@ccclass('start')
export class start extends Component {
    // [1]
   
   

    // [2]
    // @property
    // serializableDummy = 0;

    @property({ type: Label })
    private timecount = null;

    @property({ type: Canvas })
    private stage = null;
    
    start () {
        
        // [3]
        
        // this.node.on(cc.Node.)
        this.node.on(Node.EventType.TOUCH_END,function(event){
            console.log("start");
            // console.log(_this.stage);
            this.node.active=false          
            this.stage.getComponent('gameclick').enabled =true;
            this.timecount.getComponent('timecont').enabled =true;
            this.timecount.getComponent('timecont').timestart();
            this.stage.node.getChildByName("StartTitle").active=false;
            this.stage.getComponent('gameclick').count=0;
            this.stage.node.resumeSystemEvents();
            console.log(this.stage.node.getChildByName("StartTitle"));
            
        },this)
    }

    // update (deltaTime: number) {
    //     // [4]
    // }

}

/**
 * [1] Class member could be defined like this.
 * [2] Use `property` decorator if your want the member to be serializable.
 * [3] Your initialization goes here.
 * [4] Your update function goes here.
 *
 * Learn more about scripting: https://docs.cocos.com/creator/3.4/manual/zh/scripting/
 * Learn more about CCClass: https://docs.cocos.com/creator/3.4/manual/zh/scripting/decorator.html
 * Learn more about life-cycle callbacks: https://docs.cocos.com/creator/3.4/manual/zh/scripting/life-cycle-callbacks.html
 */
